package com.jml.btrace.controller;

import com.jml.btrace.entity.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BtraceController {

	@RequestMapping("/arg1")
	public String arg(@RequestParam("name")String name){
		return "hello"+name;
	}

	@RequestMapping("/constructor")
	public User constructor(User user){
		return user;
	}

	@RequestMapping("/same")
	public String arg(@RequestParam("name")String name,@RequestParam("id")String id){
		return "hello"+name+id;
	}
	@RequestMapping("/exception")
	public String exception(){
		try {
			System.out.println("start..");
			int i  = 1/0;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "hello";
	}

	@RequestMapping("/argComplex")
	public User argComplex(User user){
		return user;
	}
}
